// 引入request
import request from '../util/request.js';
import config from '../util/config.js';
const OptionLogRequest = {
    BASE_URL : config.sysUrl + "/sys",
    // 请求过程在这里开发，不在.vue文件中开发
    /**
     * 多条件分页查询log列表
     * @param log
     * @param callBack
     */
    loadOptionLog(log, callBack){
        // 拼接url  /sys/queryByPage?xxx
        let url = this.BASE_URL + "/optionLog/queryByPage";
        // 调用request进行请求  http://lcation
        request.get(url,log,callBack);
    },

    /**
     * 通过id加载日志信息的API
     * @param logId
     * @param callBack
     */
    getById(logId,callBack){
        let url = this.BASE_URL + "/optionLog/get?logId=" + logId;
        request.get(url,null,callBack);
    }
    ,
    /**
     * 修改字典信息的API
     * @param dict
     * @param callBack
     */
    updateDict(dict,callBack){
        let url = this.BASE_URL + "/dict/update";
        request.post(url,dict,callBack);
    },
    /**
     *  删除字典的API
     * @param dictId
     * @param callBack
     */
    deleteDict(dictId,callBack){
        request.get(this.BASE_URL + "/dict/delete?dictId=" + dictId,null,callBack);
    },
    /**
     * 批量删除字典的API
     * @param dictIds
     * @param callBack
     */
    deleteDicts(dictIds,callBack){
        let url = this.BASE_URL + "/dict/deletes?a=1";
        for (let i = 0; i < dictIds.length; i++){
            url += "&dictId="+dictIds[i];
        }
        request.get(url,null,callBack);
    }
}
// 导出我们申明的dictrequest对象
export default OptionLogRequest;